package com.xtt.akka.chapter1;

import java.util.UUID;

import akka.actor.AbstractActor;
import akka.actor.UntypedActor;
import akka.japi.pf.FI.UnitApply;

public class SimpleActor extends UntypedActor{

	  
    public SimpleActor() {  
          System.out.println( "SimpleActor constructor");  
    }  
 
    @Override
    public void onReceive(Object msg) throws Exception {  
 
          System.out.println( "Received Command: " + msg );  
          if (msg instanceof Command) {  
              final String data = ((Command) msg).getData();  
              final Event event = new Event(data, UUID.randomUUID().toString());  
              // emmit an event somewhere...  
 
         } else if (msg .equals("echo" )) {  
        	 System.out.println( "ECHO!");  
         }  
    }  

}
